/*
 * @(#)MenuBean.java  
 *
 * Project: CUPSecureBM
 * 
 * Modify Information:
 *  Author          Date                Description
 * ==============   =================   =====================
 *  yonggangguo     2005-12-28             Create this file
 *
 * Copyright notice:
 *   Copyright (c) 2001-2005 Beijing HiTRUST Technology Co., Ltd.
 *   1808 Room, Science & Technology Building, No. 9 South Street,
 *   Zhong Guan Cun, Haidian District, Beijing ,100081, China
 *   All rights reserved.
 *
 *   This software is the confidential and proprietary information of
 *   HiTRUST.COM, Inc. ('Confidential Information').  You shall not
 *   disclose such Confidential Information and shall use it only in
 *   accordance with the terms of the license agreement you entered
 *   into with HiTRUST.
 */

package com.hitrust.gs.util.menu;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * 标签、菜单、菜单项的父类
 */
public class MenuBean implements Cloneable, Serializable{
    /**
     * 功能代码
     */
    protected String funcCode;
    
    /**
     * 上级功能代码
     */
    protected String parentFuncCode;
    
    /**
     * 功能名称
     */
    protected String funcName;
    
    /**
     * 菜单等级
     * 0：标签
     * 1：一级菜单
     * 2：二级菜单
     */
    protected String menuLevel;
    
    /**
     * 功能类型
     * 0：根-标签
     * 1：树-非具体功能
     * 2：具体功能
     */
    protected String funcType;
    
    /**
     * 下级所有的菜单（菜单、菜单项）
     */
    protected ArrayList subMenuBeans = new ArrayList();
    
    /**
     * 取得功能代码
     * @return
     */
    public String getFuncCode() {
        return funcCode;
    }

    /**
     * 取得功能名称
     * @return
     */
    public String getFuncName() {
        return funcName;
    }

    /**
     * 取得功能类型
     * @return
     */
    public String getFuncType() {
        return funcType;
    }

    /**
     * 取得菜单等级
     * @return
     */
    public String getMenuLevel() {
        return menuLevel;
    }

    /**
     * 取得上级功能代码
     * @return
     */
    public String getParentFuncCode() {
        return parentFuncCode;
    }

    /**
     * 
     * @param string
     */
    public void setFuncCode(String string) {
        funcCode = string;
    }

    /**
     * 
     * @param string
     */
    public void setFuncName(String string) {
        funcName = string;
    }

    /**
     * 
     * @param string
     */
    public void setFuncType(String string) {
        funcType = string;
    }

    /**
     * 
     * @param string
     */
    public void setMenuLevel(String string) {
        menuLevel = string;
    }

    /**
     * 
     * @param string
     */
    public void setParentFuncCode(String string) {
        parentFuncCode = string;
    }

    /**
     * 取得所有下级菜单
     * @return ArrayList
     */
    public ArrayList getSubMenuBeans() {
        return subMenuBeans;
    }

    /**
     * 
     * @param list
     */
    public void setSubMenuBeans(ArrayList list) {
        subMenuBeans = list;
    }
    
    /**
     * 
     * 克隆对象，深层复制
     *
     * @version V1.0
     * @author yonggangguo
     */
    public Object clone() {
        MenuBean tMenuBean = null;

        try {
            tMenuBean = (MenuBean)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        
        tMenuBean.subMenuBeans = (ArrayList)this.subMenuBeans.clone();
        
        return tMenuBean;
    }
}
